import request from '@/utils/request'

export default{
  getTeacherListPage(current, size, teacherQuery) {
    return request({
      url: `/eduservice/teacher/pageTeacherCondition/${current}/${size}`,
      method: 'post',
      // 后端使用RequestBody获取数据时，用下列方式,把对象转换成json传递到后端接口
      data: teacherQuery
    })
  },
  // 删除讲师
  deleteTeacher(id) {
    return request({
      url: `/eduservice/teacher/${id}`,
      method: 'delete'
    })
  },
  // 添加讲师
  addTeacher(teacher) {
    return request({
      url: `/eduservice/teacher/addTeacher`,
      method: 'post',
      data: teacher
    })
  },
  // 通过id查讲师
  getTeacherInfo(id) {
    return request({
      url: `/eduservice/teacher/getTeacher/${id}`,
      method: 'get'
    })
  },
  updateTeacher(teacher) {
    return request({
      url: `/eduservice/teacher/updateTeacher`,
      method: 'post',
      data: teacher
    })
  },
  // 2 查询所有讲师
  getListTeacher() {
    return request({
      url: `/eduservice/teacher/findAll`,
      method: 'get'
    })
  }

}

